package cn.com.oidreams.common.enums;

import lombok.Getter;

/**
 * @author 五六七
 * @description: 异常编码枚举
 * @date 2020/7/30 16:43
 */
public enum ExceptionCode implements ICommonEnum {
    SUCCESS(0,"成功"),
    FAIL(201,"操作失败"),
    ILLEGAL_USER(202,"非法用户"),
    NO_AUTHORIZATION(204,"无权访问"),
    ERROR(400,"错误请求"),
    MISSING_PARAMETERS(401,"参数缺失"),
    MISSING_REQUIRED_PARAMETERS(402,"缺少必要参数"),
    UNAUTHORIZED(403,"登入失效"),
    VERIFICATION_FAILED(404,"验证不通过"),
    SYSTEM_ERROR(500,"服务器繁忙...");
    @Getter
    private String value;
    @Getter
    private Integer key;
    ExceptionCode(Integer key, String value) {
        this.key=key;
        this.value = value;
    }
    @Override
    public String getCode() { return key.toString(); }
}
